package logic

import (
	"context"
	"goods_srv/goods"
	"goods_srv/internal/svc"
	"goods_srv/model/redis"

	"github.com/zeromicro/go-zero/core/logx"
)

type GetGoodsStockLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewGetGoodsStockLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetGoodsStockLogic {
	return &GetGoodsStockLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 获取商品库存

func (l *GetGoodsStockLogic) GetGoodsStock(in *goods.GetGoodsStockReq) (*goods.GetGoodsStockResp, error) {

	//获取商品虚拟库存
	redis.GetGoodsStock(int(in.GoodsId))
	return &goods.GetGoodsStockResp{}, nil
}
